package com.yuw.tcpd;

import java.net.*;

import java.io.*;

import java.util.*;

import java.util.concurrent.*;

public class Socket_one//客户端

{

    private static final int PORT=6666;//端口

    public static String user;

    public static Socket socket;

    public Socket_one(String user)

    {

        this.user=user;

        try{

            socket=new Socket("192.168.0.104",PORT);//建立socket连接

            System.out.println("【"+user+"】欢迎来到聊天室！");

            Thread tt=new Thread(new Recove(socket,user));//建立客户端线程

            tt.start();//启动线程

        }catch(Exception ex)

        {

            ex.printStackTrace();

        }

    }

    public static void main(String[] args) throws Exception

    {

        new Socket_one(user);

    }

}

